package practice1_100;

import java.util.ArrayList;

public class Practice1288 {
    public int removeCoveredIntervals(int[][] intervals) {
        if(intervals.length==0) return 0;
        ArrayList<Integer> list=new ArrayList<>();
        for (int i=0;i<intervals.length-1;i++){
            for (int j=i+1;j<intervals.length;j++){
                if (intervals[i][0]<=intervals[j][0]&&intervals[i][1]>=intervals[j][1]){
                    list.add(i);
                    break;
                }
            }
        }
    return intervals.length- list.size();
    }

    public static void main(String[] args) {
        int res=new Practice1288().removeCoveredIntervals(new int[][]{{1,4},{3,6},{2,8}});
        System.out.println(res);
    }
}
